/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ifrr.gepro.sprint.bean;

import br.ifrr.gepro.estoria.bean.EstimativasBean;
import br.ifrr.gepro.estoria.bean.EstoriasBean;
import br.ifrr.gepro.pessoa.bean.TecnicoBean;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author rafael
 */
@Entity
@Table(name = "est_do_sprint", catalog = "gepro", schema = "public")

public class EstDoSprintBean implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, insertable=false)
    private Integer id;
    @Column(name = "tipo", length = 250)
    private String tipo;
    @OneToMany(mappedBy = "fkEstoria")
    private Collection<EstimativasBean> estimativasBeanCollection;
    @JoinColumn(name = "fk_responsavel", referencedColumnName = "id_tecnico")
    @ManyToOne
    private TecnicoBean fkResponsavel;
    @JoinColumn(name = "fk_sprint", referencedColumnName = "id_sprint")
    @ManyToOne
    private SprintBean fkSprint;
    @JoinColumn(name = "fk_estoria", referencedColumnName = "id_est")
    @ManyToOne
    private EstoriasBean fkEstoria;
    

    public EstDoSprintBean() {
    }

    public EstDoSprintBean(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public Collection<EstimativasBean> getEstimativasBeanCollection() {
        return estimativasBeanCollection;
    }

    public void setEstimativasBeanCollection(Collection<EstimativasBean> estimativasBeanCollection) {
        this.estimativasBeanCollection = estimativasBeanCollection;
    }

    public TecnicoBean getFkResponsavel() {
        return fkResponsavel;
    }

    public void setFkResponsavel(TecnicoBean fkResponsavel) {
        this.fkResponsavel = fkResponsavel;
    }

    public SprintBean getFkSprint() {
        return fkSprint;
    }

    public void setFkSprint(SprintBean fkSprint) {
        this.fkSprint = fkSprint;
    }

    public EstoriasBean getFkEstoria() {
        return fkEstoria;
    }

    public void setFkEstoria(EstoriasBean fkEstoria) {
        this.fkEstoria = fkEstoria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstDoSprintBean)) {
            return false;
        }
        EstDoSprintBean other = (EstDoSprintBean) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ifrr.gepro.EstDoSprintBean[ id=" + id + " ]";
    }
    
}
